import {reactive,onMounted,onBeforeUnmount} from "vue";
function savaPoint(){
    // 实现鼠标打点的数据
    let piont = reactive({
        x:0,
        y:0
    })
    // 实现鼠标打点的方法
    function savaPoine(event){
        piont.x = event.pageX;
        piont.y = event.pageY;
        console.log(event)
    }

    onMounted(()=>{
        window.addEventListener('click',savaPoine)
    })
    onBeforeUnmount(()=>{
        window.removeEventListener('click',savaPoine);
    })
    return piont
}

export default {
    savaPoint
}